from base.base_page import *
import allure,time
from locators.add_group_name_locators import *
class Add_GroupNamePages(Base):
    @allure.step("输入用户名称")
    def input_user_name(self,user:str):
        # 输入账号名
        self.input_texts(*user_password,num=0,content=user)
    @allure.step("输入用户密码")
    def input_user_password(self,password:str):
        # 输入密码
        self.input_texts(*user_password, num=1, content=password)
    @allure.step("点击用户登录")
    def click_login_btn(self):
        self.click_element(*login_btn)
    @allure.step("点击用户列表")
    def click_userList(self):
        self.click_elements(*user_btn, num = 1)
    @allure.step("点击用户分组icon")
    def click_userIcon(self):
        self.click_element(*user_group_icon)
    @allure.step("点击添加分组")
    def click_add_groupName(self):
        self.click_element(*click_add_group)
        time.sleep(2)
    @allure.step("输入新增用户分组")
    def send_user_group(self):
        self.input_texts(*input_group_name,num=2,content=group_name + uuid_)
    @allure.step("点击确定按钮")
    def click_accept(self):
        self.click_elements(*click_accept,num=2)
    @allure.step("断言文本内容")
    def assert_text(self):
        time.sleep(2)
        text = self.get_text(*accept_group)
        assert text == group_name+uuid_


